package com.wxx.observer;

import java.util.Observable;
import java.util.Observer;

/**
 * @author Jetwang
 * @version 1.0
 * @date 2022/5/27 21:00
 */
public class Teacher implements Observer {
    private String teacherName;

    public Teacher(String teacher) {
        this.teacherName = teacher;
    }

    @Override
    public void update(Observable o, Object arg) {
        Course course = (Course)o;
        Question question = (Question)arg;
        System.out.println(teacherName + "老师的" + course.getCourseName()
                + "课程接受到一个" + question.getUserName() + "提交的问题:"  + question.getQuestionContent());
    }
}
